package com.scau.service.impl.business;

import java.io.Serializable;

import org.springframework.stereotype.Component;

import com.scau.exception.BusinessException;
import com.scau.model.business.Category;
import com.scau.service.BaseService;

@Component
public class CategoryService extends BaseService<Category> implements
		Serializable {
	public void save(Category category) throws BusinessException {
		if (null != category) {
			if (null != category.getId() && 0 != category.getId()) {
				update(category);
			} else {
				add(category);
			}
		} else {
			throw new BusinessException("类别Category不能为空。");
		}
	}
}
